package unit4.part12.vip;

public class Player {
    int exp = 0;
    int[] increases;

    public Player(int exp, int[] increases) {
        this.exp = exp;
        this.increases = increases;
    }

    /**
     * 1:0-300,20
     * 2:301-500,10
     * 3:501-600,5
     */
    void gainExp() {
        if (exp <= 300) {
            exp += getIncrease(0);
        } else if (exp <= 500) {
            exp += getIncrease(1);
        } else if (exp <= 600) {
            exp += getIncrease(2);
        }
        if (exp > 600) {
            exp = 600;
        }
    }

    public int getIncrease(int level) {
        return increases[level];
    }
}
